﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLToolkit.Mapping;
using BLToolkit.DataAccess;
using DAL;

namespace Entities.Admin
{
    [TableName("KetQuaGiaiDau")]
    public class KetQuaGiaiDau : BaseEntity<KetQuaGiaiDau>
    {
        [PrimaryKey]
        public int MaGiaiDau { get; set; }
        public string DoiVoDich { get; set; }
        public string  DoiVeNhi { get; set; }
        public string DoiVeBa { get; set; }
        public string CauThuXS { get; set; }
        public string ThuMonXS { get; set; }
        public string VuaPhaLuoi { get; set; }
        public string GhiChu { get; set; }

        [MapIgnore]
        public string TenGiaiDau { 
            get {
                GiaiDau gd = GiaiDau.Objects.GetById(MaGiaiDau);
                if (gd != null)
                    return gd.TenGiaiDau;
                return "";
            }
            }
        [MapIgnore]
        public DateTime ThoiGian
        {
            get
            {
                GiaiDau gd = GiaiDau.Objects.GetById(MaGiaiDau);
                if (gd != null)
                    return gd.ThoiGianBatDau;
                return DateTime.Now;
            }
        }
    }
}
